# Maintainer: Celeste <cielesti@protonmail.com>
maintainer="Celeste <cielesti@protonmail.com>"
pkgname=emacs-llama
pkgver=0.3.1_git20240722
_gitrev=ab2b4b1f4eb1abe9dbac99d0d6df45108aaef7cd
pkgrel=0
_pkgreal=llama
pkgdesc="Compact syntax for short lambda"
url="https://git.sr.ht/~tarsius/llama"
arch="noarch"
license="GPL-3.0-or-later"
depends="cmd:emacs"
makedepends="emacs-nox"
source="$pkgname-$_gitrev.tar.gz::https://git.sr.ht/~tarsius/llama/archive/$_gitrev.tar.gz"
builddir="$srcdir/$_pkgreal-$_gitrev"

build() {
	emacs -batch -q -no-site-file -L . \
		-eval '(setq byte-compile-error-on-warn t)' \
		-f batch-byte-compile \
		./*.el
}

check() {
	emacs -batch -q -no-site-file -L . \
		-l ert -l llama-test -f ert-run-tests-batch-and-exit
}

package() {
	install -Dvm644 llama.el llama.elc \
		-t "$pkgdir"/usr/share/emacs/site-lisp/

	cd "$pkgdir"/usr/share/emacs/site-lisp
	emacs -batch -q -no-site-file \
		-eval "(loaddefs-generate \".\" \"$_pkgreal-loaddefs.el\")"
}

sha512sums="
a8979ada51e68d036261616b064d18667fb635d5461377c5ccffcb256ee4ab93372d70cf951cf675ab4b9a0c47c47f6c721b0210fb2e69b1198f2aba1dc79b4d  emacs-llama-ab2b4b1f4eb1abe9dbac99d0d6df45108aaef7cd.tar.gz
"
